package BC;

import org.bouncycastle.operator.OperatorCreationException;
import java.io.IOException;
import java.security.*;
import java.security.cert.CertificateException;

public class sm2_cert {
    public static void main(String[] args) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, CertificateException, OperatorCreationException, IOException {
        String certName="lzc_cert_demo"+".cer";
        SM2Util sm2 = new SM2Util();
        // 生成密钥生成器
        KeyPairGenerator kpg=sm2.generator();
        // 产生密钥对
        KeyPair keyPair = kpg.generateKeyPair();
        sm2.cert(keyPair,certName);
        System.out.println("签发成功");
    }

}
